package com.example.cloud.action;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.example.cloud.biz.UserBiz;
import com.example.cloud.domain.model.user.UserDO;

/**
 * UserAction
 *
 * @author tongyufu
 */
@RestController
public class UserAction {

    @Autowired
    private UserBiz userBiz;

    /**
     * 获取用户信息
     *
     * @return 用户信息
     */
    @RequestMapping(value = "/feign-user", method = RequestMethod.GET)
    public List<UserDO> getUser() {
        List<UserDO> users = new ArrayList<UserDO>();
        users.add(userBiz.getUser(2, "用户2"));
        users.add(userBiz.getUser(new UserDO(3, "用户3")));
        return users;
    }

}
